package com;

import lombok.SneakyThrows;
import org.junit.Test;

/**
 * @author Liangyaoyun
 */
public class 异常处理 {
    //自动补全try、catch与finally
    public void method01(int num) {
        if (num == 0) {
            throw new RuntimeException("你的除数不能为0");
        }
        System.out.println(100 / num);
    }

    @SneakyThrows
    @Test
    public void test() {
        method01(0);
    }
    public interface fu{
        void methon1() throws Exception;
        void methon2();
    }
    public static class ziImpl implements fu{

        @Override
        public void methon1() throws Exception {

        }

        @Override
        public void methon2() {

        }
    }
    @Test
    public void test1(){

    }
}
